/*
 * @Author: 15801208559 1593215788@qq.com
 * @Date: 2023-12-07 12:52:00
 * @LastEditors: 15801208559 1593215788@qq.com
 * @LastEditTime: 2023-12-11 15:08:07
 * @FilePath: \dm-gpt-survery\dm-chatgpt-web\src\router\index.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { useMemo, useState } from "react";
import routes from './routers'
import { Routes,  Route} from "react-router-dom";
import { Spin } from "antd";
import loadable from "@loadable/component";

  const fellbackStyle = {
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
    minHeight: 500,
    fontSize: 24,
  };

  // 路由列表d
  const outLists: RouterInfo[] = []
  routes.forEach(item => {
    console.log('%c [ item ]-17', 'font-size:13px; background:pink; color:#bf2c9f;', item)
    const {components , ...anyProps} = item
    const Com = loadable(item.components, { fallback: <Spin style={fellbackStyle} tip="页面加载中...." /> })
    outLists.push({...anyProps, components: Com})
  })

export default Router;